package com.tzbank.wisdom.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.tzbank.utils.CodeUtil;
import com.tzbank.utils.ResultUtil;
import com.tzbank.wisdom.service.HomePageInfoService;

import lombok.extern.slf4j.Slf4j;

/**
 * 首页信息查询
 * 2018-07-12
 * @author wangbin
 *
 */
@Slf4j
@RequestMapping("homePageInfo")
@RestController
public class HomePageInfoController {
	@Autowired
	private HomePageInfoService homePageInfoService;

	/**
	 * 首页信息查询入口
	 * @param request
	 * @param reqBody
	 * @return
	 */
	@PostMapping(value = "/getListModuleInfo")
	public Map<String, Object> getListModuleInfo(HttpServletRequest request,
			@RequestParam Map<String, String> reqBody) {
		try {
			return homePageInfoService.getListModuleInfo(reqBody);
		} catch (Exception e) {
			log.error("HomePageInfoController getListModuleInfo异常: ", e);
			return ResultUtil.resultMap(CodeUtil.CODE_500.getName(), CodeUtil.CODE_500.getCode(), null);
		}
	}
}
